﻿<%@ Page Language="C#" AutoEventWireup="false" Inherits="Bee.Web.BeePageView" %>

<%@ Import Namespace="Bee.Web" %>
<%@ Import Namespace="Bee" %>
<%@ Import Namespace="System.Collections.Generic" %>

<% System.Data.DataTable dataTable = Model as System.Data.DataTable;  %>
<div style="float: left; display: block; margin: 10px; overflow: auto; width: 350px;
    border: solid 1px #CCC; line-height: 21px; background: #FFF;" layouth="56">
    <ul id="<%=PageId %>tree" class="tree expand ">
        <%=HtmlHelper.ForTree(dataTable, "parentid", "name", "id", "id asc", "o0", "<ul>", "</ul>", 
            "<li><a tvalue={1} onclick='Edit" + PageId +"({1});'>{0}</a>", "</li>")%>
    </ul>
</div>


<script type="text/javascript">

    var Edit<%=PageId %> = function (id) {
        var json = arguments[0];
        bee.PostData("/Organization/Detail.bee", { id: id }, function(data) {
            var $form = $("#content<%=PageId %>");
            autoFill($form, data);
            $("#roletree<%=PageId %>").treeVal(data["roleinfo"]);
        });
    }

</script>

